package com.wdh.kjs.fragment;

import android.os.Bundle;
import android.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ScrollView;

import com.wdh.kjs.Adapter.InvestmentDetailFourAdapter;
import com.wdh.kjs.Adapter.ListViewForScrollView;
import com.wdh.kjs.R;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

/**
 * Created by dingh on 2016/4/21.
 */
public class InvestmentDetailFourFragment extends Fragment {
    private ListViewForScrollView investmentdetail_listview;
    private ScrollView investmentdetail_scrollview;
    private InvestmentDetailFourAdapter investmentDetailAdapter;
    private List<HashMap<String, String>> datas;
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_investmentdetail_four, container, false);
        initView(view);
        initwidge();
        return view;
    }
    private void initView(View view) {
        investmentdetail_listview = (ListViewForScrollView) view.findViewById(R.id.fragment_investmentdetail_four_listview);
        investmentdetail_scrollview = (ScrollView) view.findViewById(R.id.fragment_investmentdetail_four_scrollview);
        investmentdetail_scrollview.smoothScrollTo(0, 0);

    }
    private void initwidge() {
        investmentDetailAdapter=new InvestmentDetailFourAdapter(getActivity(),initListViewData());
        investmentdetail_listview.setAdapter(investmentDetailAdapter);
    }
    private List<HashMap<String, String>> initListViewData() {
        datas = new ArrayList<>();
        for(int i=0;i<5;i++){
            HashMap<String, String> hashMap = new HashMap<>();
            hashMap.put("tv_item_id_four_phone", "m1****66");
            hashMap.put("tv_item_id_four_money", "50,000.00");
            hashMap.put("tv_item_id_four_time", "2016-4-21 15:35:01");
            datas.add(hashMap);
        }
        return datas;

    }
}
